﻿using System;
using System.ComponentModel;

namespace Devv.FreshTracker.Entity
{
	[Serializable]
	public class RuleCollection : BindingList<Rule>
	{
		#region Helpers

		public Rule Find(String title)
		{
			foreach (Rule r in this)
			{
				if (r.Code == Rule.GetCode(title))
				{
					return r;
				}
			}

			return null;
		}

		#endregion
	}
}